<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<!DOCTYPE html>
<html class="x-admin-sm">
<% String path = request.getContextPath()+"/"; %>
<head>
    <base href="<%=path%>">
    <meta charset="UTF-8">
    <title>人力资源信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="stylesheet" href="layui/css/font.css">
    <link rel="stylesheet" href="layui/css/xadmin.css">
    <script src="layui/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="layui/js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr >
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                (一)管理层概况
                            </td>
                        </tr>
                        </thead>
                        <tbody>
                        <tr >
                            <td align="center">

                            </td>
                            <td colspan="7">
                                <table align="center">
                                    <tr align="center">
                                        <td>
                                            序号
                                        </td>
                                        <td>
                                            姓名
                                        </td>
                                        <td>
                                            职务
                                        </td>
                                        <td>
                                            任职期限
                                        </td>
                                        <td>
                                            兼职情况
                                        </td>
                                        <td>
                                            简介
                                        </td>
                                    </tr>
                                    <c:forEach items="${HR.managers}" var="manager" varStatus="vs">
                                    <tr>
                                        <td align="center">
                                            ${vs.count}
                                        </td>
                                        <td>
                                            <input type="text" name="name" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${manager.name}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="job" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${manager.job}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="jobTime" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${manager.jobTime}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="partJob" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${manager.partJob}">
                                        </td>
                                        <td align="center">
                                                <button  class="layui-btn" lay-filter="add" onclick="xadmin.open('管理层介绍','skip/humanResources/managerDesc?id='+${manager.id},'700','340', false)" >
                                            <i class="layui-icon">&#xe642;</i></button>                                 
                                             </td>
                                    </tr>
                                    </c:forEach>
                                    <tr >
                                        <td colspan="5" style="border-right: none">

                                        </td>
                                        <td  align="right" style="border-left: none">
                                            <%--添加行js--%>

                                            <button class="layui-btn">
                                                <i class="layui-icon"></i></button>
                                        </td>

                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <!-- <tr>
                             <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                 (二)胜任能力和薪酬
                             </td>

                         </tr>
                         <tr>
                             <td rowspan="2">
                                 高级管理人员简介
                             </td>
                             <td colspan="7">
                                    <textarea placeholder="请输入内容" id="desc" name="desc" class="layui-textarea">
                                        高级管理人员简介
                                    </textarea>

                             </td>
                         </tr>
                         <tr>

                             <td colspan="7">
                                 <button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传文件</button>
                             </td>
                         </tr>
                         <tr>
                             <td>
                                 职工薪酬情况
                             </td>
                             <td colspan="7">
                                 <table align="center">
                                     <tr align="center">
                                         <td>
                                             序号
                                         </td>
                                         <td>
                                             项目
                                         </td>
                                         <td>
                                             2018年度
                                         </td>
                                         <td>
                                             2019年度
                                         </td>
                                         <td>
                                            2020年度
                                         </td>
                                         <td>
                                             备注
                                         </td>
                                     </tr>
                                     <tr align="center">
                                         <td>
                                             1
                                         </td>
                                         <td>
                                             年工资总额
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="无">
                                         </td>
                                     </tr>
                                     <tr align="center">
                                         <td>
                                             2
                                         </td>
                                         <td>
                                             年平均人数
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="无">
                                         </td>
                                     </tr>
                                     <tr align="center">
                                         <td>
                                             3
                                         </td>
                                         <td>
                                             年人均工资
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="无">
                                         </td>
                                     </tr>
                                     <tr align="center">
                                         <td>
                                             4
                                         </td>
                                         <td>
                                             工资总额增长比例
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="*">
                                         </td>
                                         <td>
                                             <input type="text" id="L_email" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="无">
                                         </td>
                                     </tr>
                                 </table>
                             </td>
                         </tr>-->
                        <tr>
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                (二)人才引进及科研技术人员概况
                            </td>
                        </tr>
                        <tr>
                            <td rowspan="2">

                            </td>
                            <td  colspan="7">
                                 <textarea placeholder="请输入内容" id="desc" name="desc" class="layui-textarea" >
                                     ${HR.talentsOverview}
                                 </textarea>
                            </td>
                        </tr>
                        <tr>

                            <td colspan="7">
                                <button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传相关附件</button>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="8" style="font-size: 16px;font-weight: bold;">
                                (三)员工概况
                            </td>
                        </tr>
                        <tr>
                            <td>

                            </td>
                            <td  colspan="7">
                                <table align="center">
                                    <tr align="center">
                                        <td rowspan="3">
                                            1
                                        </td>
                                        <td>
                                            项目
                                        </td>
                                        <td>
                                            公司中高层
                                        </td>
                                        <td>
                                            公司员工
                                        </td>
                                        <td>
                                            临时人员
                                        </td>
                                        <td>
                                            合计
                                        </td>
                                    </tr>
                                    <c:forEach items="${employee}" var="emp">
                                        <c:if test="${emp.project == 1}">
                                    <tr align="center">

                                        <td>
                                            人数
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.midTop}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.staff}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.shorttimeEmp}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.employeeTotal}">
                                        </td>
                                    </tr>
                                    <tr align="center">

                                        <td>
                                            比例（%）
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input"  value="<fmt:formatNumber type='percent' value='${emp.midTop / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.staff / emp.employeeTotal}'/>  ">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.shorttimeEmp / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.employeeTotal / emp.employeeTotal}'/>">
                                        </td>
                                    </tr>
                                        </c:if>
                                    </c:forEach>
                                    <tr align="center">
                                        <td rowspan="3">
                                            2
                                        </td>
                                        <td>
                                            项目
                                        </td>
                                        <td>
                                            管理人员
                                        </td>
                                        <td>
                                            技术人员
                                        </td>
                                        <td>
                                            其他人员
                                        </td>
                                        <td>
                                            合计
                                        </td>
                                    </tr>
                                    <c:forEach items="${employee}" var="emp">
                                        <c:if test="${emp.project == 2}">
                                    <tr align="center">
                                        <td >
                                            人数
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.midTop}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.staff}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.shorttimeEmp}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.employeeTotal}">
                                        </td>
                                    </tr>
                                    <tr align="center">
                                        <td>
                                            比例(%)
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.midTop / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.staff / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.shorttimeEmp / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.employeeTotal / emp.employeeTotal}'/>">
                                        </td>
                                    </tr>
                                        </c:if>
                                    </c:forEach>
                                    <tr align="center">
                                        <td rowspan="3">
                                            3
                                        </td>
                                        <td>
                                            项目
                                        </td>
                                        <td>
                                            硕士及以上学历
                                        </td>
                                        <td>
                                            本科学历
                                        </td>
                                        <td>
                                            本科以下学历
                                        </td>
                                        <td>
                                            合计
                                        </td>
                                    </tr>
                                    <c:forEach items="${employee}" var="emp">
                                        <c:if test="${emp.project == 3}">
                                    <tr align="center">
                                        <td>
                                            人数
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.midTop}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.staff}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.shorttimeEmp}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.employeeTotal}">
                                        </td>
                                    </tr>
                                    <tr align="center">
                                        <td>
                                            比例(%)
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.midTop / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.staff / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.shorttimeEmp / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.employeeTotal / emp.employeeTotal}'/>">
                                        </td>
                                    </tr>
                                        </c:if>
                                    <</c:forEach>
                                    <tr align="center">
                                        <td rowspan="3">
                                            4
                                        </td>
                                        <td>
                                            项目
                                        </td>
                                        <td>
                                            30以下
                                        </td>
                                        <td>
                                            30-40岁
                                        </td>
                                        <td>
                                            40以上
                                        </td>
                                        <td>
                                            合计
                                        </td>
                                    </tr>
                                    <c:forEach items="${employee}" var="emp">
                                        <c:if test="${emp.project == 4}">
                                    <tr align="center">
                                        <td>
                                            人数
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.midTop}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.staff}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.shorttimeEmp}">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="${emp.employeeTotal}">
                                        </td>
                                    </tr>
                                    <tr align="center">
                                        <td>
                                            比例(%)
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.midTop / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.staff / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.shorttimeEmp / emp.employeeTotal}'/>">
                                        </td>
                                        <td>
                                            <input type="text" id="" name="email" required="" lay-verify="email" autocomplete="off" class="layui-input" value="<fmt:formatNumber type='percent' value='${emp.employeeTotal / emp.employeeTotal}'/>">
                                        </td>
                                    </tr>
                                        </c:if>
                                    </c:forEach>
                                </table>
                            </td>
                        </tr>
                        <tr align="center">
                            <td colspan="8">
                                <button class="layui-btn" lay-filter="add" lay-submit="">保存</button>
                                <button class="layui-btn" lay-filter="add" lay-submit="">提交</button>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['laydate','form','upload'], function(){
        var laydate = layui.laydate;
        var  form = layui.form;
        var $ = layui.jquery;
        var upload = layui.upload;


        // 监听全选
        form.on('checkbox(checkall)', function(data){

            if(data.elem.checked){
                $('tbody input').prop('checked',true);
            }else{
                $('tbody input').prop('checked',false);
            }
            form.render('checkbox');
        });
//指定允许上传的文件类型
        upload.render({
            elem: '#test3'
            ,url: 'https://httpbin.org/post' //改成您自己的上传接口
            ,accept: 'file' //普通文件
            ,done: function(res){
                layer.msg('上传成功');
                console.log(res);
            }
        });
        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });


    });

    /*用户-停用*/
    function member_stop(obj,id){
        layer.confirm('确认要停用吗？',function(index){

            if($(obj).attr('title')=='启用'){

                //发异步把用户状态进行更改
                $(obj).attr('title','停用')
                $(obj).find('i').html('&#xe62f;');

                $(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用');
                layer.msg('已停用!',{icon: 5,time:1000});

            }else{
                $(obj).attr('title','启用')
                $(obj).find('i').html('&#xe601;');

                $(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用');
                layer.msg('已启用!',{icon: 5,time:1000});
            }

        });
    }

    /*用户-删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }



    function delAll (argument) {
        var ids = [];

        // 获取选中的id
        $('tbody input').each(function(index, el) {
            if($(this).prop('checked')){
                ids.push($(this).val())
            }
        });

        layer.confirm('确认要删除吗？'+ids.toString(),function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
    }
</script>
</html>